using DesignPattern.Creational.AbstractFactory.Manufactor;
using DesignPattern.Creational.AbstractFactory.MobilePhone;
using DesignPattern.Creational.AbstractFactory.Television;

namespace DesignPattern.Creational.AbstractFactory
{
    /// <summary>
    /// 抽象工厂
    /// </summary>
    public class AbstractFactoryPattern
    {
        public static void Test()
        {
            AbstractProduct product = ManufactorCreater.Manufactor(SelectManufactor.Huawei);
            IMobilePhone mobilePhone = product.ProduceMobilePhone();
            mobilePhone.Call();
            mobilePhone.Sms();
            ITelevision television = product.ProduceTelevision();
            television.WatchTV();

            product = ManufactorCreater.Manufactor(SelectManufactor.Mi);
            mobilePhone = product.ProduceMobilePhone();
            mobilePhone.Call();
            mobilePhone.Sms();
            television = product.ProduceTelevision();
            television.WatchTV();
        }
    }
}